﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace UtilZ.Dotnet.WindowsDesktopEx.WPF
{
    /// <summary>
    /// WPF-TreeView扩展类
    /// </summary>
    public static class TreeViewEx
    {
        ///// <summary>
        ///// 展开全部子节点
        ///// </summary>
        ///// <param name="treeView">TreeView</param>
        //public static void Expand(this TreeView treeView)
        //{
        //    foreach (var item in treeView.Items)
        //    {
        //        DependencyObject dependencyObject = treeView.ItemContainerGenerator.ContainerFromItem(item);
        //        if (dependencyObject != null)
        //        {
        //            ((TreeViewItem)dependencyObject).ExpandSubtree();
        //        }
        //    }
        //}

        //<TreeView.ItemContainerStyle>
        //        <Style TargetType = "TreeViewItem" >
        //            < Setter Property="IsExpanded" Value="True"/>
        //            <Setter Property = "Margin" Value="0,3,0,0"/>
        //        </Style>
        //    </TreeView.ItemContainerStyle>
    }
}
